# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.AndroidManagement.V1.Model.KeyedAppState do
  @moduledoc """
  Keyed app state reported by the app.

  ## Attributes

  *   `createTime` (*type:* `DateTime.t`, *default:* `nil`) - The creation time of the app state on the device.
  *   `data` (*type:* `String.t`, *default:* `nil`) - Optionally, a machine-readable value to be read by the EMM. For example, setting values that the admin can choose to query against in the EMM console (e.g. “notify me if the battery_warning data < 10”).
  *   `key` (*type:* `String.t`, *default:* `nil`) - The key for the app state. Acts as a point of reference for what the app is providing state for. For example, when providing managed configuration feedback, this key could be the managed configuration key.
  *   `lastUpdateTime` (*type:* `DateTime.t`, *default:* `nil`) - The time the app state was most recently updated.
  *   `message` (*type:* `String.t`, *default:* `nil`) - Optionally, a free-form message string to explain the app state. If the state was triggered by a particular value (e.g. a managed configuration value), it should be included in the message.
  *   `severity` (*type:* `String.t`, *default:* `nil`) - The severity of the app state.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :createTime => DateTime.t() | nil,
          :data => String.t() | nil,
          :key => String.t() | nil,
          :lastUpdateTime => DateTime.t() | nil,
          :message => String.t() | nil,
          :severity => String.t() | nil
        }

  field(:createTime, as: DateTime)
  field(:data)
  field(:key)
  field(:lastUpdateTime, as: DateTime)
  field(:message)
  field(:severity)
end

defimpl Poison.Decoder, for: GoogleApi.AndroidManagement.V1.Model.KeyedAppState do
  def decode(value, options) do
    GoogleApi.AndroidManagement.V1.Model.KeyedAppState.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.AndroidManagement.V1.Model.KeyedAppState do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
